.class public Lcom/xingbook/xingbook/a/a;
.super Lcom/xingbook/park/a/a;

# interfaces
.implements Lcom/xingbook/park/ui/o;


# instance fields
.field private f:Lcom/xingbook/xingbook/d/l;

.field private g:Landroid/app/Activity;

.field private h:Ljava/util/ArrayList;

.field private i:Z

.field private j:Z

.field private k:Z


# direct methods
.method public constructor <init>(Landroid/app/Activity;Lcom/xingbook/xingbook/d/l;Lcom/xingbook/park/c/a/p;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, p3}, Lcom/xingbook/park/a/a;-><init>(Landroid/app/Activity;Lcom/xingbook/park/c/a/p;)V

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->k:Z

    iput-object p1, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    iput-object p2, p0, Lcom/xingbook/xingbook/a/a;->f:Lcom/xingbook/xingbook/d/l;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    return-void
.end method


# virtual methods
.method public a(IZ)Lcom/xingbook/park/c/a/n;
    .locals 4

    const/4 v1, 0x0

    const/16 v0, 0x30

    if-ne p1, v0, :cond_0

    new-instance v1, Lcom/xingbook/xingbook/d/i;

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    iget v2, p0, Lcom/xingbook/xingbook/a/a;->a:F

    iget-object v3, p0, Lcom/xingbook/xingbook/a/a;->f:Lcom/xingbook/xingbook/d/l;

    invoke-direct {v1, v0, v2, v3, p0}, Lcom/xingbook/xingbook/d/i;-><init>(Landroid/content/Context;FLcom/xingbook/xingbook/d/l;Lcom/xingbook/park/ui/o;)V

    :cond_0
    if-eqz v1, :cond_1

    instance-of v0, v1, Lcom/xingbook/service/download/m;

    if-eqz v0, :cond_1

    iget-object v2, p0, Lcom/xingbook/xingbook/a/a;->e:Ljava/util/ArrayList;

    new-instance v3, Ljava/lang/ref/WeakReference;

    move-object v0, v1

    check-cast v0, Lcom/xingbook/service/download/m;

    invoke-direct {v3, v0}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    :cond_1
    return-object v1
.end method

.method public a(Z)V
    .locals 2

    const/4 v1, 0x0

    iput-boolean p1, p0, Lcom/xingbook/xingbook/a/a;->k:Z

    if-nez p1, :cond_0

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    iput-boolean v1, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    iput-boolean v1, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    :cond_0
    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->notifyDataSetChanged()V

    return-void
.end method

.method public declared-synchronized a(Ljava/lang/String;)Z
    .locals 4

    const/4 v1, 0x0

    const/4 v2, 0x1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    iget-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    if-eqz v0, :cond_6

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    move v0, v2

    :goto_0
    iget-object v3, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-nez v3, :cond_5

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    :goto_1
    if-eqz v2, :cond_0

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    instance-of v0, v0, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    check-cast v0, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;

    const/4 v2, 0x0

    invoke-virtual {v0, v2}, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;->a(Z)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_0
    move v0, v1

    :goto_2
    monitor-exit p0

    return v0

    :cond_1
    :try_start_1
    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    iget-object v3, p0, Lcom/xingbook/xingbook/a/a;->c:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-ne v0, v3, :cond_4

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    move v0, v2

    :goto_3
    iget-boolean v1, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    if-nez v1, :cond_2

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    move v0, v2

    :cond_2
    if-eqz v0, :cond_3

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    instance-of v0, v0, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;

    if-eqz v0, :cond_3

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    check-cast v0, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;->a(Z)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :cond_3
    move v0, v2

    goto :goto_2

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0

    :cond_4
    move v0, v1

    goto :goto_3

    :cond_5
    move v2, v0

    goto :goto_1

    :cond_6
    move v0, v1

    goto :goto_0
.end method

.method public declared-synchronized b(Ljava/lang/String;)Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized c()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->notifyDataSetChanged()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const/4 v0, 0x1

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized d()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->i:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized e()Z
    .locals 3

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->c:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->c:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_1

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->notifyDataSetChanged()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_0
    const/4 v0, 0x0

    monitor-exit p0

    return v0

    :cond_1
    :try_start_1
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    iget-object v2, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    check-cast v0, Lcom/xingbook/b/n;

    invoke-virtual {v0}, Lcom/xingbook/b/n;->t()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized f()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->j:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public g()Z
    .locals 1

    invoke-super {p0}, Lcom/xingbook/park/a/a;->g()Z

    move-result v0

    return v0
.end method

.method public h()Z
    .locals 1

    iget-boolean v0, p0, Lcom/xingbook/xingbook/a/a;->k:Z

    return v0
.end method

.method public i()Z
    .locals 8

    const/4 v7, 0x1

    const/4 v6, 0x0

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-gtz v0, :cond_0

    iput-boolean v6, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    iput-boolean v6, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->notifyDataSetChanged()V

    :goto_0
    return v6

    :cond_0
    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    invoke-static {v0}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/n;->g()Lcom/xingbook/park/d/e;

    move-result-object v0

    iget-object v1, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Lcom/xingbook/park/d/e;->a(Ljava/util/ArrayList;)Z

    move-result v0

    if-eqz v0, :cond_5

    new-instance v3, Ljava/util/ArrayList;

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    invoke-direct {v3, v0}, Ljava/util/ArrayList;-><init>(I)V

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :cond_1
    :goto_1
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->h:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    iput-boolean v6, p0, Lcom/xingbook/xingbook/a/a;->j:Z

    iput-boolean v6, p0, Lcom/xingbook/xingbook/a/a;->i:Z

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_4

    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->notifyDataSetChanged()V

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    const-string v1, "\u5220\u9664\u6210\u529f\uff01"

    invoke-static {v0, v1, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    goto :goto_0

    :cond_2
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    if-eqz v0, :cond_1

    const-string v1, ""

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_1

    iget-object v1, p0, Lcom/xingbook/xingbook/a/a;->c:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :cond_3
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    move-object v1, v2

    check-cast v1, Lcom/xingbook/b/n;

    invoke-virtual {v1}, Lcom/xingbook/b/n;->t()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    check-cast v2, Lcom/xingbook/xingbook/b/c;

    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_1

    :cond_4
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/b/n;

    iget-object v2, p0, Lcom/xingbook/xingbook/a/a;->c:Ljava/util/ArrayList;

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    goto :goto_2

    :cond_5
    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    const-string v1, "\u5220\u9664\u5931\u8d25\uff01"

    invoke-static {v0, v1, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    goto/16 :goto_0
.end method

.method public notifyDataSetChanged()V
    .locals 3

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    instance-of v0, v0, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/xingbook/a/a;->g:Landroid/app/Activity;

    check-cast v0, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;

    invoke-virtual {v0, v2}, Lcom/xingbook/xingbook/activity/MyDownXingBookActivity;->a(Z)V

    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->g()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->j()Lcom/xingbook/park/c/a/o;

    move-result-object v0

    const-string v1, "\u66f4\u591a\u7cbe\u5f69\uff0c\u70b9\u51fb\u8fdb\u5165\u300e\u661f\u5b9d\u542c\u542c\u300f\u770b\u770b\u5427~"

    invoke-virtual {v0, v2, v1}, Lcom/xingbook/park/c/a/o;->a(ZLjava/lang/String;)V

    :cond_0
    :goto_0
    invoke-super {p0}, Lcom/xingbook/park/a/a;->notifyDataSetChanged()V

    return-void

    :cond_1
    invoke-virtual {p0}, Lcom/xingbook/xingbook/a/a;->j()Lcom/xingbook/park/c/a/o;

    move-result-object v0

    const-string v1, "\u6ca1\u6709\u5185\u5bb9\u54e6,\u70b9\u51fb\u8fdb\u5165\u300e\u661f\u5b9d\u513f\u6b4c\u300f\u770b\u770b\u5427~"

    invoke-virtual {v0, v2, v1}, Lcom/xingbook/park/c/a/o;->a(ZLjava/lang/String;)V

    goto :goto_0
.end method
